package org.geektimes.projects.user.web.listener;

import org.geekbang.projects.config.ConfigContext;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* 作业监听器  
* @author : lsq
*/
public class TaskListener implements ServletContextListener {

	private static final Logger logger = Logger.getLogger(TaskListener.class.getName());


	@Override
	public void contextInitialized(ServletContextEvent sce) {
		logger.log(Level.INFO ,"第一次作业url:" + "http://localhost:{port}" + "/user/view/register");
		logger.log(Level.INFO , "JMX作业 read http://localhost:{port}/jolokia/read/org.geektimes.projects.user.web:type=IOC");
		logger.log(Level.INFO , "JMX作业 exec http://localhost:{port}/jolokia/exec/org.geektimes.projects.user.web:type=IOC/toBeansString/");
		logger.log(Level.INFO ,"configuration 作业: [application.name :" + ConfigContext.INSTANCE.getValue("application.name" , String.class) +"]");

	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {

	}
}
